/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.fyx.mula.entity;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ydenek
 */
@Entity
@Table(name = "mula_translate")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MulaTranslate.findAll", query = "SELECT m FROM MulaTranslate m"),
    @NamedQuery(name = "MulaTranslate.findByKey", query = "SELECT m FROM MulaTranslate m WHERE m.mulaTranslatePK.key = :key"),
    @NamedQuery(name = "MulaTranslate.findByIsoLanguage", 
        query = "SELECT m FROM MulaTranslate m WHERE m.mulaTranslatePK.isoLanguage = :isoLanguageh")})
public class MulaTranslate implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected MulaTranslatePK mulaTranslatePK;
    @Lob
    @Size(max = 65535)
    @Column(name = "_translate")
    private String translate;

    public MulaTranslate() {
    }

    public MulaTranslate(MulaTranslatePK mulaTranslatePK) {
        this.mulaTranslatePK = mulaTranslatePK;
    }

    public MulaTranslate(String key, String isoLanguage) {
        this.mulaTranslatePK = new MulaTranslatePK(key, isoLanguage);
    }

    public MulaTranslatePK getMulaTranslatePK() {
        return mulaTranslatePK;
    }

    public void setMulaTranslatePK(MulaTranslatePK mulaTranslatePK) {
        this.mulaTranslatePK = mulaTranslatePK;
    }

    public String getTranslate() {
        return translate;
    }

    public void setTranslate(String translate) {
        this.translate = translate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (mulaTranslatePK != null ? mulaTranslatePK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MulaTranslate)) {
            return false;
        }
        MulaTranslate other = (MulaTranslate) object;
        if ((this.mulaTranslatePK == null && other.mulaTranslatePK != null) || (this.mulaTranslatePK != null && !this.mulaTranslatePK.equals(other.mulaTranslatePK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.fyx.mula.entity.MulaTranslate[ mulaTranslatePK=" + mulaTranslatePK + " ]";
    }
    
}
